package com.qianfeng.smartplatform.pojo;

import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Date;

public class Scene implements Serializable, CheckEmptyInterface {
    private Long sceneId;

    private String sceneName;

    private Integer createBy;

    private Date createTime;

    private Short status;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean isEmpty(CheckType checkType) {
        switch (checkType) {
            case ADD:

                return StringUtils.hasText(sceneName);
            case UPDATE:
                return ObjectUtils.isEmpty(sceneId) || StringUtils.hasText(sceneName);

        }
        return CheckEmptyInterface.super.isEmpty(checkType);
    }

    public Long getSceneId() {
        return sceneId;
    }

    public void setSceneId(Long sceneId) {
        this.sceneId = sceneId;
    }

    public String getSceneName() {
        return sceneName;
    }

    public void setSceneName(String sceneName) {
        this.sceneName = sceneName == null ? null : sceneName.trim();
    }

    public Integer getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Integer createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }
}